import { getCategoryFilterAPI } from "@/apis/category";
import { ref, onMounted } from "vue";
import { useRoute } from "vue-router";

export function useCategory() {
  const categoryData = ref({});
  const route = useRoute();
  const getCategoryFilter = async (id) => {
    const res = await getCategoryFilterAPI(id);
    categoryData.value = res.result;
  };

  onMounted(() => {
    getCategoryFilter(route.params.id);
  });
  return { categoryData };
}
